//
//  UIView+Category.h
//  AutoMart
//
//  Created by Abner on 2017/7/28.
//  Copyright © 2017年 Abner. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Category)

@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGFloat right;
@property (nonatomic, assign) CGFloat bottom;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint origin;

@end

@interface NSObject (Category)

//!字符串是否合法
- (BOOL)isValidString;
//!数组是否合法
- (BOOL)isValidArray;
//!字典串是否合法
- (BOOL)isValidDict;
//!是否合法手机号
//- (BOOL)isRightPhoneNum;

@end

@interface NSString (Category)

//!是否合法手机号
- (BOOL)isRightPhoneNum;

- (NSString *)safetyPhoneNum;

- (NSString *)standardPriceFormat;

// 32位小写
+ (NSString *)MD5ForLower32Bate:(NSString *)str;
// 32位大写
+ (NSString *)MD5ForUpper32Bate:(NSString *)str;
// 16为大写
+ (NSString *)MD5ForUpper16Bate:(NSString *)str;
// 16位小写
+ (NSString *)MD5ForLower16Bate:(NSString *)str;
//md5加密
+ (NSString *)MD5:(NSString *)str;
//和现在的时间比较
+ (NSInteger)compareDateWithNow:(NSString*)aDate;

@end

@interface UICollectionView (Category)

- (void)setMJHeaderWithTarget:(id)target
         withRefreshingAction:(SEL)refreshingAction;

- (void)setMJFooterWithTarget:(id)target
         withRefreshingAction:(SEL)refreshingAction;

@end

@interface UITableView (Category)

- (void)setMJHeaderWithTarget:(id)target
         withRefreshingAction:(SEL)refreshingAction;

- (void)setMJFooterWithTarget:(id)target
         withRefreshingAction:(SEL)refreshingAction;

@end

@interface UIImage (Category)

+ (UIImage *)createImageWithColor:(UIColor *)color;

- (UIImage *)imageWithColor:(UIColor *)color;

@end

@interface UILabel (Category)

- (void)textAlignmentLeftAndRight;

/**
 *  改变行间距
 */
- (void)changeLineSpace:(CGFloat)space;

/**
 *  改变字间距
 */
- (void)changeWordSpace:(CGFloat)space;

/**
 *  改变行间距和字间距
 */
- (void)changeLineSpace:(CGFloat)lineSpace AndWordSpace:(CGFloat)wordSpace;

@end

